From: Colin Walters Date: Wed, 20 Aug 2014 14:23:28 +0000 (-0400) Subject: fetcher: Close request body on error paths X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~1126 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=c08a4503ced62e66418a4bc0c8cb519e783ca3b6;p=ostree.git fetcher: Close request body on error paths Otherwise, we're potentially holding up subsequent requests. I was hitting this when testing the metalink code, where we want to continue doing more fetches after hitting a 404. https://bugzilla.gnome.org/show_bug.cgi?id=729585 --- diff --git a/src/libostree/ostree-fetcher.c b/src/libostree/ostree-fetcher.c index 298ba63f..3cc3533e 100644 --- a/src/libostree/ostree-fetcher.c +++ b/src/libostree/ostree-fetcher.c @@ -505,6 +505,8 @@ on_request_sent (GObject *object, out: if (local_error) { + if (pending->request_body) + (void) g_input_stream_close (pending->request_body, NULL, NULL); g_simple_async_result_take_error (pending->result, local_error); g_simple_async_result_complete (pending->result); g_object_unref (pending->result);